Please share this dialog freely. If you make modifications, I'd appreciate receiving a copy! I also wouldn't mind getting credit in your application if you use this in-house.
By no means a be-all-end-all Export dialog, this layout attempts to mimic some of the functionality of the built-in 4D Export dialog. I've opted to not use any externals for SFDialogs or file placement.
Several components of the scripts could/should be placed in the Startup procedures (for example, the aFiles array only needs to be loaded ONCE). I've kept all the code together for ease of transport. Just copy the layout "Export Dialog" to your database, check for variable naming conflicts, and you are on your way.
` Variables used:
`---------------
` aFiles - array containing the names of all files in the database (S15)
` aFields - array of field names for the selected file (S15)
` aFieldPtr - array of pointers to each field in the selected file (PTR)
` aUserFields - array of field names the User has chosen to export (S15)
` aUserFldPtr - array of pointers to fields the User has chosen to export (PTR)
` bAllRecs - select all records (Button)
` bAppend - append field to user list (Button)
` bExpHeader - include headers checkbox (Checkbox)
` bExport - export records (Button)
` bInsert - insert field into user list (Button)
` bInsertAll- move all fields to the user list (Button)
` bOK - OK button in dialog
` CR - carriage return character
` DocRef - document reference returned by Create Document